package com.zhanggm.springcloud.repair.api;

import com.zhanggm.springcloud.common.entity.Car;
import com.zhanggm.springcloud.common.entity.CarRepairShop;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(name = "service-car")
public interface CarApi {

    @GetMapping("/car/getById")
    public Car getById(@RequestParam("id") Integer id);

    @GetMapping("/car/shop/getById")
    public CarRepairShop getShopById(@RequestParam("id") Integer id);

    @GetMapping("/car/listAll")
    public List<Car> listAll();

    @GetMapping("/car/listByName")
    public List<Car> listByName(@RequestParam("name") String name);

    @GetMapping("/car/getListByIds")
    public List<Car> getListByIds(@RequestParam("ids") List<Integer> ids);
}
